# -*- coding: utf-8 -*-(for Scipe)
DEF $Left  $Right    # fl2 = control of 2 flaps   parameters= output channel  Left / Right
# input variables are ail prof courb brake  

#____ flap combines  symmetrical actions  on the flaps : prof  , courb
# flap > 0 is down 
prof.flap: INIT -10.00 # snap flap
courb.flap.U: INIT -20 # the 4th axis
courb.flap.D: INIT -20 # the 4th axis
brake.flap: INIT 80.00
flap	 ADDAS	courb    courb.flap.D: courb.flap.U:    
flap     ADDAS	prof   prof.flap: 0 # classical snap flap , only down
flap	   ADDS	brake   brake.flap:   

#________split flaps and add the mixer aileron-> flaps

# differential mix ail->flap with compensation of the hardware assymetry
ail.flap.up:		INIT 50
ail.flap.down:	INIT 35  # 100% each side = no differential only if the geometry of the servo command is symmetrical

flapR    SUBAS ail  ail.flap.down:  ail.flap.up:  #aileron right  +=down -=up $diff
flapL    ADDAS ail  ail.flap.up:   ail.flap.down:    #aileron left,+=down -=up
flapL   ADD flapL flap
flapR   ADD flapR flap

#servo travel
flapL.U: INIT 100.00
flapL.C: INIT 0.00
flapL.D: INIT -100.00
flapR.U: INIT 100.00
flapR.C: INIT 0.00
flapR.D: INIT -100.00
flapL.s	SERV flapL flapL.D: flapL.C: flapL.U:
flapR.s	SERV flapR flapR.D: flapR.C: flapR.U:  
@V$Left	OUTN flapL.s 	1.55 .55
@V$Right	OUTN flapR.s 	1.55 .55
